<%-- 
    Document   : register
    Created on : Mar 12, 2013, 12:16:50 AM
    Author     : dizonfarleyjr
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="styles/style.css" rel="stylesheet" type="text/css" media="all"/>
        <!-- JS -->
	<script src="script/jquery-1.4.1.min.js" type="text/javascript"></script>	
	<script src="script/jquery.jcarousel.pack.js" type="text/javascript"></script>	
	<script src="script/jquery-func.js" type="text/javascript"></script>
        <script src="script/validation.js" type="text/javascript"></script>
	<!-- End JS -->
        <title>FooBar Shop!</title>
    </head>
    <body>
     <% 
           if("Customer".equals(session.getAttribute("loggedUserType")))  
                response.sendRedirect("loggedin.jsp");
           else if("Administrator".equals(session.getAttribute("loggedUserType")))
               response.sendRedirect("admin.jsp");
           else if("Product Manager - Book".equals(session.getAttribute("loggedUserType")))
               response.sendRedirect("bookProductManager.jsp");
           else if("Product Manager - AudioCD".equals(session.getAttribute("loggedUserType")))
               response.sendRedirect("audioCDProductManager.jsp");
           else if("Product Manager - Magazine".equals(session.getAttribute("loggedUserType")))
               response.sendRedirect("magazineProductManager.jsp");
           else if("Product Manager - DVD".equals(session.getAttribute("loggedUserType")))
               response.sendRedirect("dvdProductManager.jsp");
           else if("Accounting Manager".equals(session.getAttribute("loggedUserType")))
               response.sendRedirect("AccountingManager.jsp");
%>
     <!-- Start Shell -->
      <div class="shell">
	<!-- Header -->	
	<div id="header">
		<h1 id="logo"><a href="index.jsp">ALDIGOY</a></h1>	
		
                <!-- Cart -->
		<div id="cart">
			<a href="#" class="cart-link">Your Shopping Cart</a>
			<div class="cl">&nbsp;</div>
			<span>You must be logged in.</span>
			&nbsp;&nbsp;	
		</div>
		<!-- End Cart -->
		
		<!-- Navigation -->
		<div id="navigation">
			<ul>
			    <li><a href="index.jsp">Home</a></li>
			    <li><a href="register.jsp" class="active">Register</a></li>
			    <li><a href="login.jsp">Login</a></li>
			    <li><a href="#">About Us</a></li>
			    
			</ul>
		</div>
		<!-- End Navigation -->
	</div>
	<!-- End Header -->
	
	<!-- Main -->
	<div id="main">
		<div class="cl">&nbsp;</div>
		
		<!-- Content -->
		<div id="content">
			
		<form name="registrationForm" method="POST" action="registerServlet" autocomplete="off" onSubmit="return validateRegistration();">
                <table>
                
                <tr>
                     <td colspan="2"><b><u>Account Information</u></b></td>
                    <td><span id="nameError" style="color:red"></span></td>
                </tr>
                <tr>
                    <td><input type="text" name="nameFirst" class="field" maxlength="45" onchange="validateFirstName();"/></td>
                    <td><input type="text" name="nameMiddleI" class="field" maxlength="45" onchange="validateMI();"/></td>
                    <td><input type="text" name="nameLast" class="field" maxlength="45" onchange="validateLastName();"></td>
                </tr>
                <tr>
                    <td>First Name</td>
                    <td>M.I.</td>
                    <td>Last Name</td>
                </tr>
                <tr></tr>
                <tr>
                    <td>Username</td><td><input type="text" name="username" class="field" maxlength="45" onchange="validateUsername();"/></td>
                            <td><span id="userError" style="color:red"></span></td>
                        </tr>
                        <tr>
                            <td>Password</td><td><input type="password" name="password" class="field" maxlength="32" onchange="validatePassword();"/></td>
                            <td><span id="passError" style="color:red"></span></td>
                        </tr>
                        <tr>
                            <td>Re-type Password</td><td><input type="password" name="retypePassword" class="field" onchange="validatePasswords();"></td>
                            <td><span id="retypeError" style="color:red"></span></td>
                        </tr>
                        <tr>
                            <td>Telephone No.</td><td><input type="text" name="telephone" class="field" maxlength="20" onchange="validateTelephone();"/></td>
                            <td><span id="TelNoError" style="color:red"></span></td>
                        </tr>
                        <tr>
                            <td>Email Address</td><td><input type="text" name="email" class="field" maxlength="70" onchange="validateEmail();"/></td>
                            <td><span id="emailError" style="color:red"></span></td>
                        </tr>
                        <tr>
                            <td></td>
                        </tr>
                        <tr>
                            <td colspan="2"><b><u>Delivery Information</u></b></td>
                        </tr>
                        <tr>
                            <td>House Number</td><td><input type="text" name="AddressDeliveryNumber" class="field" maxlength="45" onchange="validateAddressDeliveryNumber();"></td>
                            <td><span id="houseError" style="color:red"></span></td>
                        </tr>
                        <tr>
                            <td>Street</td><td><input type="text" name="AddressDeliveryStreet" class="field" maxlength="45" onchange="validateAddressDeliveryStreet();"/></td>
                            <td><span id="streetError" style="color:red"></span></td>
                        </tr>
                        <tr>
                            <td>Subdivision</td><td><input type="text" name="AddressDeliverySubdivision" class="field" maxlength="45" onchange="validateAddressDeliverySubdivision();"/></td>
                            <td><span id="subError" style="color:red"></span></td>
                        </tr>
                        <tr>
                            <td>City</td><td><input type="text" name="AddressDeliveryCity" class="field" maxlength="45" onchange="validateAddressDeliveryCity();"></td>
                            <td><span id="cityError" style="color:red"></span></td>
                        </tr>
                        <tr>
                            <td>Postal Code</td><td><input type="text" name="AddressDeliveryPostal" class="field" maxlength="10" onchange="validateAddressDeliveryPostal();"/></td>
                            <td><span id="postalError" style="color:red"></span></td>
                        </tr>
                        <tr>
                            <td>Country</td><td><input type="text" name="AddressDeliveryCountry" class="field" maxlength="45" onchange="validateAddressDeliveryCountry();"/></td>
                            <td><span id="countryError" style="color:red"></span></td>
                        </tr>
                        
                        
                        <tr>
                            <td><b><u>Billing Information</u></b></td>
                        </tr>
                        <tr>
                            <td>Name on Credit Card</td><td><input type="text" name="creditName" class="field" maxlength="45" onchange="validateCreditName();"/></td>
                            <td><span id="cNameError" style="color:red"></span></td>
                        </tr>
                        <tr>
                            <td>Credit Card Number</td><td><input type="text" name="creditNumber" class="field" maxlength="16" onchange="validateCreditNumber();"/></td>
                            <td><span id="cNumError" style="color:red"></span></td>
                        </tr>
                        <tr>
                            <td>Credit Card Company</td><td><select name ="creditCompany" class="field">
                                <option value="Visa">Visa</option>
                                <option value="Mastercard">Mastercard</option>
                                </select></td>
                        </tr>
                        <tr>
                            <td>Expiration [MM:YYYY]</td>
                            <td><input type="text" name="creditMonth" class="field" maxlength="2" onchange="validateExpiration();"/></td>
                            <td><input type="text" name="creditYear" class="field" maxlength="4" onchange="validateExpiration();"/></td>
                            <td><span id="cExpireError" style="color:red"></span></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td>Month</td>
                            <td>Year</td>
                        </tr>
                        
                        <tr>
                            <td><b><u>Billing Address</u></b></td>
                        </tr>
                        <tr>
                            <td>House Number</td><td><input type="text" name="addressBillNumber" class="field" maxlength="45" onchange="validateAddressBillNumber();"></td>
                            <td><span id="cHouseError" style="color:red"></span></td>
                        </tr>
                        <tr>
                            <td>Street</td><td><input type="text" name="addressBillStreet" class="field" maxlength="45" onchange="validateAddressBillStreet();"/></td>
                            <td><span id="cStreetError" style="color:red"></span></td>
                        </tr>
                        <tr>
                            <td>Subdivision</td><td><input type="text" name="addressBillSubdivision" class="field" maxlength="45" onchange="validateAddressBillSubdivision();"/></td>
                            <td><span id="cSubError" style="color:red"></span></td>
                        </tr>
                        <tr>
                            <td>City</td><td><input type="text" name="addressBillCity" class="field" maxlength="45" onchange="validateAddressBillCity();"></td>
                            <td><span id="cCityError" style="color:red"></span></td>
                        </tr>
                        <tr>
                            <td>Postal Code</td><td><input type="text" name="addressBillPostal" class="field" maxlength="10" onchange="validateAddressBillPostal();"/></td>
                            <td><span id="cPostalError" style="color:red"></span></td>
                        </tr>
                        <tr>
                            <td>Country</td><td><input type="text" name="addressBillCountry" class="field" maxlength="45" onchange="validateAddressBillCountry();"/></td>
                            <td><span id="cCountryError" style="color:red"></span></td>
                        </tr>
                <tr>
                    <td><input type="submit" name="registerButton" value="Register" class="search-submit"/></td>
                </tr>
            </table>
        </form>
			
		</div>
		<!-- End Content -->
		
		<!-- Sidebar -->
		<div id="sidebar">
			
			<!-- Search -->
			<div class="box search">
				<h2>Search by <span></span></h2>
				<div class="box-content">
					<form action="searchProductServlet" method="post">
						
						<label>Keyword</label>
						<input type="text" class="field" name="searchKeyword" />
						
						<label>Category</label>
						<select class="field" name="searchCategory">
							<option value="All Categories">All Categories</option>
                                                        <option value="book">Books</option>
                                                        <option value="magazine">Magazines</option>
                                                        <option value="audioCD">Audio CD</option>
                                                        <option value="dvd">DVD</option>
						</select>
						
						
						<input type="submit" class="search-submit" value="Search" />
						
						<p>
							<a href="#" class="bul">Advanced search</a><br />
							<a href="#" class="bul">Contact Customer Support</a>
						</p>
	
					</form>
				</div>
			</div>
			<!-- End Search -->
			
			<!-- Categories -->
			<div class="box categories">
				<h2>Categories <span></span></h2>
				<div class="box-content">
					<ul>
					    <li><a href="viewCategoryServlet?productCategory=book">Books</a></li>
					    <li><a href="viewCategoryServlet?productCategory=magazine">Magazines</a></li>
					    <li><a href="viewCategoryServlet?productCategory=audioCD">Audio CD</a></li>
					    <li><a href="viewCategoryServlet?productCategory=dvd">DVD</a></li>
                                            <li class="last"><a href="viewCategoryServlet?productCategory=all">View All Products</a></li>
					</ul>
				</div>
			</div>
			<!-- End Categories -->
			
		</div>
		<!-- End Sidebar -->
		
		<div class="cl">&nbsp;</div>
	</div>
	<!-- End Main -->
	
	<!-- Side Full -->
	<div class="side-full">
		
		<!-- More Products -->
		<div class="more-products">
			<div class="more-products-holder">
				<ul>
				    <li><a href="#"><img src="styles/images/prod1.jpg" alt="" /></a></li>
				    <li><a href="#"><img src="styles/images/prod2.jpg" alt="" /></a></li>
				    <li><a href="#"><img src="styles/images/prod3.jpg" alt="" /></a></li>
				    <li><a href="#"><img src="styles/images/prod4.jpg" alt="" /></a></li>
				    <li><a href="#"><img src="styles/images/prod5.jpg" alt="" /></a></li>
				    <li><a href="#"><img src="styles/images/prod6.jpg" alt="" /></a></li>
                                    <li><a href="#"><img src="styles/images/prod8.jpg" alt="" /></a></li>
				    <li><a href="#"><img src="styles/images/prod9.jpg" alt="" /></a></li>
				    <li><a href="#"><img src="styles/images/prod10.jpg" alt="" /></a></li>
				    <li><a href="#"><img src="styles/images/prod11.jpg" alt="" /></a></li>
				    <li class="last"><a href="#"><img src="styles/images/prod7.jpg" alt="" /></a></li>
				</ul>
			</div>
			<div class="more-nav">
				<a href="#" class="prev">previous</a>
				<a href="#" class="next">next</a>
			</div>
		</div>
		<!-- End More Products -->
		
		<!-- Text Cols -->
		<div class="cols">
			<div class="cl">&nbsp;</div>
			<div class="col">
				<h3 class="ico ico1">Fast Delivery</h3>
				<p>We offer one of the fastest delivery services in the whole world.</p>
				<p class="more"><a href="#" class="bul">Learn more</a></p>
			</div>
			<div class="col">
				<h3 class="ico ico2">Customer Service</h3>
				<p>Inquire and learn more about products by talking with our friendly staff.</p>
				<p class="more"><a href="#" class="bul">Learn more</a></p>
			</div>
			<div class="col">
				<h3 class="ico ico3">Gift Service</h3>
				<p>Browsing for a gift? Look no further, we offer one of the safest and most incredible services out there.</p>
				<p class="more"><a href="#" class="bul">Learn more</a></p>
			</div>
			<div class="col col-last">
				<h3 class="ico ico4">Shopping Cart</h3>
				<p>Got everything that you're looking for? Checkout your shopping cart now!.</p>
				<p class="more"><a href="#" class="bul">Finish Shopping</a></p>
			</div>
			<div class="cl">&nbsp;</div>
		</div>
		<!-- End Text Cols -->
		
	</div>
	<!-- End Side Full -->
	
	<!-- Footer -->
	<div id="footer">
		<p class="left">
			<a href="#">Home</a>
			<span>|</span>
			<a href="#">Register</a>
			<span>|</span>
			<a href="#">Login</a>
			<span>|</span>
			<a href="#">About Us</a>
			<span>|</span>
			
		</p>
		<p class="right">
			&copy; 2013 FooBar Shop.
			
		</p>
	</div>
	<!-- End Footer -->
	
</div>	
<!-- End Shell -->
      
      
      
      
    </body>
</html>